package utils;

import java.sql.Connection;
import java.sql.DriverManager;

import com.mysql.jdbc.Driver;

public class ConnectionFactory {
	public static Connection getConnection() throws Exception{
		try {
//			Class.forName(Driver.class.getName());
			DriverManager.registerDriver(new Driver());
			return DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "");
		} catch (Exception e) {
			throw new Exception("Ocorreu um erro ao se conectar no banco. \nMensagem:" + e.getMessage());
		}
	}
}
